home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 79 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.7 KB

  1. From: thp@cs.ucr.edu (Tom Payne)
  2. Message-ID: <4dok0e$5i7@galaxy.ucr.edu>
  3. X-Original-Date: 19 Jan 1996 17:22:22 GMT
  4. Path: in2.uu.net!bounce-back
  5. Date: 20 Jan 96 04:10:38 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Re: Throwing an exception from within a si
  9. Organization: University of California, Riverside Department of Computer Science
  10. References: <4dgj4m$9la@engnews1.Eng.Sun.COM> <DLCosx.Hn1@falcon.daytonoh.attgis.com>
  11. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  12. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  13.     iQBFAgUBMQBrZuEDnX0m9pzZAQGR3QF/ReGnVVpfYU0qTWhsnIBGrcc5+j+fmQD7
  14.     J9rmy4gojmg8hbyXQZNNH6I3xHZn1xvx
  15.     =8JdR
  16.  
  17. Dick Menninger (Dick.Menninger@daytonoh.attgis.com) wrote:
  18. :
  19. : > ==========Steve Clamage, 1/16/96==========
  20. :  
  21. : > In article 22h@galaxy.ucr.edu, thp@cs.ucr.edu (Tom Payne) writes:
  22. : > >Implicit in a qestion of what the Standard says are the related
  23. : > >questions of what it should say and why --- why shouldn't signal
  24. : > >handlers be allowed to throw exceptions?  (The question seems both
  25. : > >interesting and appropriate.)
  26. :  
  27. : > [...]
  28. : Signal handlers are analogous to interrupt handlers at
  29. : application level.  They form separate asynchronous
  30. : processing that may communicate to the rest of the
  31. : application but are really a separate thread.  How they
  32. : communicate to the rest of the application is colored
  33. : thoroughly by their nature.  The problem in thinking
  34. : about exceptions in signal handlers seems to be that
  35. : everybody is treating them as part of the thread they interrupt.
  36. : That leads you down the path to oblivion.  They should
  37. : be seen as a separate thread of execution.  An exception
  38. : does not go back through the special save boundary.
  39. : To do that would be like an exception in one thread
  40. : continuing through another threads stack.  When you
  41. : look at a signal handler as a threadlike thing that happens
  42. : to preempt another thread, you start making sensible
  43. : decisions that allow a signal handler to do that little
  44. : more that is probably necessary.  Since exceptions
  45. : are required at rather basic levels now, precluding
  46. : them is very unrealistic.
  47.  
  48. Good analysis, but I'm unclear about the conclusion.  Functions called
  49. by signal handlers should be allowed to throw exceptions.  If,
  50. however, the signal handler itself throws an exception or fails to
  51. catch one thrown to it, then the situation seems analogous to the base
  52. function of a thread throwing an exception or failing to catch one
  53. thrown to it.  Shouldn't we consider that a bug?
  54.  
  55. Tom Payne (thp@cs.ucr.edu)
  56. ---
  57. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  58.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  59.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  60.